package tree.binarytree2;


public interface IBinaryTree {
    class TreeNode {
        public char val;
        public TreeNode left;
        public TreeNode right;

        public TreeNode(char val) {
            this.val = val;
        }
    }

    /**
     * 创建一棵二叉树 返回这棵树的根节点
     */
    TreeNode createTree();

    // 前序遍历
    void preOrder(TreeNode root);

    // 中序遍历
    void inOrder(TreeNode root);

    // 后序遍历
    void postOrder(TreeNode root);

    /**
     * 获取树中节点的个数：遍历思路
     */
    void size(TreeNode root);

    int size2(TreeNode root);

    void getLeafNodeCount1(TreeNode root);

    int getLeafNodeCount2(TreeNode root);

    int getKLevelNodeCount(TreeNode root, int k);

    int getHeight(TreeNode root);

    TreeNode find(TreeNode root, char val);

    //层序遍历
    void levelOrder(TreeNode root);

    // 判断一棵树是不是完全二叉树
    boolean isCompleteTree(TreeNode root);
}
